<?php

namespace lc\controller;

use lc\helpers\Helper;
use lc\helpers\Response;
use lc\thirdparty\Demogic;

class LCAppController
{
    public static function device()
    {
        return 'device';
    }

    public function refreshDemogicAccessToken()
    {
        (new Demogic('', ''))->updateAccessToken();

        return Response::success();
    }

    public function ossSessionToken()
    {
        $ossToken = Helper::getOssSessionToken();
        if (!empty($ossToken)) {
            return Response::success($ossToken['data']);
        } else {
            return Response::fail($ossToken['msg']);
        }
    }
}